package com.chengshuang.log.fuction.task;


import com.chengshuang.log.fuction.LogRecordFunction;
import org.springframework.stereotype.Component;

/**
 * @author shuang.cheng
 * @date 2022/10/13
 * @description
 */
@Component
public class TaskTypeFunction implements LogRecordFunction {

    private final String FUNCTION_NAME = "task_type";

    @Override
    public String functionName() {
        return FUNCTION_NAME;
    }

    @Override
    public String apply(Object value) {
        if (value == null) {
            return null;
        }
        if ( 1 == (int) value) {
            return "自定义任务";
        }else if (2 == (int) value){
            return "立项任务";
        }
        return null;
    }
}
